from fastmcp import FastMCP

# 定义配置字典
config = {
    "mcpServers": {
        "weather_mcp_server": {
            "url": "http://weather_mcp_server:7861/mcp",
            "transport": "http"
        },
        "time_mcp_server": {
            "url": "http://time_mcp_server:7872/mcp",
            "transport": "http"
        },
        "12306_mcp_server": {
            "url": "http://12306_mcp_server:7873/mcp",
            "transport": "http"
        },
        "chart_mcp_server": {
            "url": "http://chart_mcp_server:7875/mcp",
            "transport": "http"
        },
        "openwebsearch_mcp_server": {
            "url": "http://openwebsearch_mcp_server:3000/mcp",
            "transport": "http"
        }
    }
}

# 使用配置创建代理服务器
main_server = FastMCP.as_proxy(config, name="MainServer")

if __name__ == "__main__":
    main_server.run(transport="streamable-http", host="0.0.0.0", port=8000)